#ifndef __losor_symbol_h__
#define __losor_symbol_h__

#include <map.h>
#include "type.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _symbol
{
    control_life();
    list *decl;
    symtype *type;
    token *name;
    struct _symbol *region;
    list *ref;
    list *beref;
} symbol;

void sym_init( smap *s, smap *t );
symbol* sym_create( symtype *ty, token *name, symbol *region );
int sym_release( symbol *s );
symbol* sym_find( const char *name );
char* sym_name( symbol *sym, int full );
int sym_size( symbol *sym );
int sym_is_type( symbol *sym );
vartype* vt_find( const char *name );

#ifdef __cplusplus
};
#endif

#endif // __losor_symbol_h__
